/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qp.smsmarketing.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author waldenilson
 */
@Entity
@Table(name = "papel")
public class Papel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
   @GeneratedValue(strategy= GenerationType.IDENTITY)
    
    @Basic(optional = false)
    @Column(name = "id_role")
    private Integer idRole;
    @Column(name = "nome_role")
    private String nomeRole;
    @Column(name = "descricao_role")
    private String descricaoRole;
    @OneToMany(mappedBy = "idRoleUsuario")
    private List<Usuario> usuarioList;

    public Papel() {
    }

    public Papel(Integer idRole) {
        this.idRole = idRole;
    }

    public Integer getIdRole() {
        return idRole;
    }

    public void setIdRole(Integer idRole) {
        this.idRole = idRole;
    }

    public String getNomeRole() {
        return nomeRole;
    }

    public void setNomeRole(String nomeRole) {
        this.nomeRole = nomeRole;
    }

    public String getDescricaoRole() {
        return descricaoRole;
    }

    public void setDescricaoRole(String descricaoRole) {
        this.descricaoRole = descricaoRole;
    }

    public List<Usuario> getUsuarioList() {
        return usuarioList;
    }

    public void setUsuarioList(List<Usuario> usuarioList) {
        this.usuarioList = usuarioList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRole != null ? idRole.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Papel)) {
            return false;
        }
        Papel other = (Papel) object;
        if ((this.idRole == null && other.idRole != null) || (this.idRole != null && !this.idRole.equals(other.idRole))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qp.smsmarketing.entity.Role[ idRole=" + idRole + " ]";
    }
    
}
